package com.demo.openlktest.controller;

import com.demo.openlktest.entity.po.CheckResult;
import com.demo.openlktest.entity.vo.Result;
import com.demo.openlktest.service.CheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CheckController {

    @Autowired
    CheckService checkService;

    @GetMapping("/isSuitableForCreditCard")
    public Result<CheckResult> isSuitableForCreditCard(String personID) {
        System.out.println(personID);
        Result<CheckResult> result = new Result<>();
        result.setData(checkService.check(personID));
        result.setMsg("200 OK");
        return result;
    }

    @GetMapping("/test")
    public void test() {
        System.out.println("test");
        checkService.test();
    }
}
